<?php declare(strict_types=1);

namespace Distributed\Event;


use Distributed\Contract\IEvent;
use Distributed\App;

/**
 * 
 * @author mg
 *
 */
class GetDataBase implements IEvent
{
	
	/**
	 * 
	 * @var array
	 */
	protected $data = [];
	
	public function __construct(array $data) 
	{
		$this->data = $data;
	}
	
	/**
	 * 
	 * {@inheritDoc}
	 * @see \Distributed\Contract\IEvent::parseEvent()
	 */
	public function parseEvent()
	{
		return App::$dbPool->getConnection()[$this->data['db_name']];
	}
	
}